using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
using Brain;
using Brain.Dev;
using Brain.Rendering;
using Brain.Logic.AI;

namespace DemosWP7
{
    public class Game1 : Game
    {
        GraphicsDeviceManager graphics;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;

            Content.RootDirectory = "Content";

            TargetElapsedTime = TimeSpan.FromTicks(333333);
            InactiveSleepTime = TimeSpan.FromSeconds(1);
        }

        protected override void Initialize()
        {
            base.Initialize();

            Engine.InitializeEngineWithDefaultManagers(this.graphics);
#if DEBUG && !MONOGAME
            //Engine.Instance.AddManager(new DefaultDebugManager());
#endif
            Engine.Instance.AddManager(new DefaultRenderManager2D(this.GraphicsDevice));
            Engine.Instance.AddManager(new DefaultRenderManager3D(this.GraphicsDevice));

            Engine.Instance.AddManager(new DefaultStereoscopicManager());

            Engine.Instance.AddManager(new DefaultAIManager());
        }

        protected override void UnloadContent()
        {
            base.UnloadContent();

            Engine.Instance.Unload();
        }


        protected override void Update(GameTime gameTime)
        {
            Engine.Instance.Update(gameTime);

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            Engine.Instance.Draw(gameTime);

            base.Draw(gameTime);
        }
    }
}
